package sms

import "fmt"

func CheckVcode(phone string, vcode int) (bool, error) {
	cacheItem, err := smsCache.Value(phone)
	fmt.Print(cacheItem)
	if err != nil {
		fmt.Print(111)
		return false,err
	}
	value := cacheItem.Data().(int)
	if value != vcode {
		fmt.Print(222)
		return false,nil
	}
	_, err = smsCache.Delete(phone)
	if err != nil {
		fmt.Print(333)
		return false,err
	}
	return true,nil
}
